﻿Imports BaseballScoreKeeper.Core
Imports NUnit.Framework

Namespace BaseballScoreKeeper.Tests.CoreTests
    <TestFixture()> _
    Public Class Test_Name
#Region "Tests"
        <Test()> _
        Public Sub Test_Function_Equals()
            Dim expectedName As New Name("Joe", "DiMaggio")

            Dim testName1 As New Name("Ken", "Griffey", NameSuffix.Junior)
            Dim testName2 As New Name("Joe", "DiMaggio")

            Assert.AreNotEqual(expectedName, testName1)
            Assert.AreEqual(expectedName, testName2)
        End Sub

        <Test()> _
        Public Sub Test_Property_FirstName()
            Dim testName As New Name("FirstName", "LastName", "MiddleName", NameSuffix.Junior)
            Assert.AreEqual("FirstName", testName.FirstName)
        End Sub

        <Test()> _
        Public Sub Test_Property_MiddleName()
            Dim testName As New Name("FirstName", "LastName", "MiddleName", NameSuffix.Junior)
            Assert.AreEqual("MiddleName", testName.MiddleName)
        End Sub

        <Test()> _
        Public Sub Test_Property_LastName()
            Dim testName As New Name("FirstName", "LastName", "MiddleName", NameSuffix.Junior)
            Assert.AreEqual("LastName", testName.LastName)
        End Sub

        <Test()> _
        Public Sub Test_Property_FullName()
            Dim testName1 As New Name("FirstName", "LastName", "MiddleName", NameSuffix.Junior)
            Assert.AreEqual("FirstName MiddleName LastName Jr.", testName1.FullName)

            Dim testName2 As New Name("FirstName", "LastName", NameSuffix.Senior)
            Assert.AreEqual("FirstName LastName Sr.", testName2.FullName)

            Dim testName3 As New Name("FirstName", "LastName", "MiddleName")
            Assert.AreEqual("FirstName MiddleName LastName", testName3.FullName)

            Dim testName4 As New Name("FirstName", "LastName")
            Assert.AreEqual("FirstName LastName", testName4.FullName)
        End Sub

        <Test()> _
        Public Sub Test_Property_Suffix()
            Dim testName As New Name("FirstName", "LastName", "MiddleName", NameSuffix.Junior)
            Assert.AreEqual(NameSuffix.Junior, testName.Suffix)
        End Sub
#End Region
    End Class
End Namespace